﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="LogViewer.aspx.cs" Inherits="System_LogViewer" Title="无标题页" Culture="auto"
    meta:resourcekey="PageResource1" UICulture="auto" %>

<%@ Register Src="~/UserControl/DataPager.ascx" TagName="DataPager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../JavaScript/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <script type="text/javascript">
        $(function () {
            var dlg = $('#dd').dialog({
                title: '日志明细',
                iconCls: 'icon-ok',
                closed: true,
                buttons: [{
                    text: '取消',
                    handler: function () {
                        $('#dd').dialog('close');
                    }
                }]
            });
            dlg.parent().appendTo(jQuery("form:first"));
        });
        function open1() {
            $('#dd').dialog('open');
        }
        function close1() {
            $('#dd').dialog('close');
        }
    </script>
    <table id="wsd_inputtable">
        <tr>
            <td class="tabletitle" colspan="4">
                搜索选项
            </td>
        </tr>
        <tr>
            <td class="tablefield">
                <asp:Literal ID="Literal13" runat="server" meta:resourcekey="Account" Text="帐号"></asp:Literal>
                :
            </td>
            <td nowrap="nowrap">
                <asp:TextBox ID="txtLoginName" runat="server" meta:resourcekey="txtLoginNameResource1"></asp:TextBox>
            </td>
            <td class="tablefield">
                日志类型:
            </td>
            <td nowrap="nowrap">
                <asp:DropDownList ID="ddlLogType" runat="server" Height="25px" meta:resourcekey="ddlLogTypeResource1"
                    Width="150px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="tablefield">
                起始日期:
            </td>
            <td nowrap="nowrap">
                <input type="text" class="Wdate" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'end_date\')||\'%y-%M-{%d}\'}'})"
                    id="start_date" />
            </td>
            <td class="tablefield">
                结束日期:
            </td>
            <td nowrap="nowrap">
                  <input type="text" class="Wdate" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'start_date\')}',maxDate:'#F{$dp.$D(\'start_date\',{d:31});}'})"
                    id="end_date" />
            </td>
        </tr>
        <tr>
            <td class="buttonarea" colspan="4">
                &nbsp;<asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查 询"
                    class="wsd_button2" />
                &nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
        <ContentTemplate>
            <table id="wsd_inputtable">
                <tr>
                    <td class="tabletitle">
                        日志列表
                    </td>
                </tr>
            </table>
            <table id="wsd_listtable" width="100%">
                <tr>
                    <td style="width: 100%">
                        <asp:GridView BorderWidth="0" ID="gridViewLogInfo" runat="server" AutoGenerateColumns="False"
                            EmptyDataText="没有可显示的数据." EmptyDataRowStyle-Font-Bold="true" EnableEmptyContentRender="true"
                            Width="100%" OnRowDataBound="gridViewLogInfo_RowDataBound" BorderStyle="None"
                            GridLines="None">
                            <HeaderStyle CssClass="titlist" />
                            <Columns>
                                <asp:BoundField HeaderText="时间" DataField="LogCreateDate">
                                    <ItemStyle HorizontalAlign="Center" Width="20%" />
                                    <HeaderStyle Width="20%" />
                                </asp:BoundField>
                                <%-- <asp:BoundField DataField="LogTypeFriendlyName" HeaderText="日志类型" ItemStyle-HorizontalAlign="Center" />--%>
                                <asp:TemplateField HeaderText="日志类型" ShowHeader="False">
                                    <ItemStyle HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="Select"
                                            Text='<%# Eval("LogTypeFriendlyName") %>' OnClientClick='<%# getUrl(Eval("LogGUID").ToString()) %>'></asp:LinkButton>
                                    </ItemTemplate>
                                    <ControlStyle Font-Underline="False" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="帐号" ShowHeader="False">
                                    <ItemStyle HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Select"
                                            Text='<%# Eval("LogUserName") %>' OnClientClick='<%# getUrl(Eval("LogGUID").ToString()) %>'></asp:LinkButton>
                                    </ItemTemplate>
                                    <ControlStyle Font-Underline="False" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="内容" ItemStyle-Width="50%">
                                    <ItemStyle HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lbl_content" Text='<%#Eval("LogContent").ToString().Length>30?Eval("LogContent").ToString().Substring(0,30)+"...":Eval("LogContent") %>'
                                            meta:resourcekey="BoundFieldResource5"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <RowStyle CssClass="evenline" />
                            <AlternatingRowStyle CssClass="oddline" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: center">
                        <table width="100%" class="pagination" cellpadding="0px" cellspacing="0px" border="0">
                            <tr>
                                <td style="height: 32px">
                                    <div class="wsd_pageleft">
                                        <asp:Button CssClass="wsd_pagebutton" ID="btnFirst" runat="server" CausesValidation="false"
                                            OnClick="btn_first_Click" Text="<%$resources:language,lbl_First_Page %>" />
                                        <asp:Button CssClass="wsd_pagebutton" ID="btnPrevious" runat="server" CausesValidation="false"
                                            OnClick="btn_per_Click" Text="<%$resources:language,lbl_PreviousPage %>" />
                                        <asp:Button CssClass="wsd_pagebutton" ID="btnNext" runat="server" CausesValidation="false"
                                            OnClick="btn_next_Click" Text="<%$resources:language,lbl_NextPage %>" />
                                        <asp:Button CssClass="wsd_pagebutton" ID="btnLast" runat="server" CausesValidation="false"
                                            OnClick="btn_end_Click" Text="<%$resources:language,lbl_Last_Page %>" />
                                    </div>
                                    <div class="wsd_pageright">
                                        <asp:Label runat="server" ID="txtInfo"> </asp:Label>
                                        第<asp:TextBox CssClass="wsd_pageinput" ID="txtPage" runat="server" Width="40px"></asp:TextBox>
                                        页
                                        <asp:Button CssClass="wsd_pagegobutton" ID="btnGoto" runat="server" Text="Go" OnClick="btnGoto_Click" />
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnFirst" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPrevious" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnNext" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnLast" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnGoto" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
